/*
 * @Author: XieQiu 雪球
 * @Date: 2021-05-12 16:59:31
 * @LastEditTime: 2021-05-18 08:54:12
 * @LastEditors: XieQiu 雪球
 * @Description: 巡检点管理接口
 */
import request from '@/utils/request'

export default {
  /**
   * @description: 获取巡检点名称列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  getInspectionPointList(params) {
    return request.post("/v3/patrol/inspectionPoint/queryPageList", params);
  },
  /**
   * @description: 获取单个巡检点信息
   * @return {Object}
   */
  getInspectionPointById(id) {
    return request.get(`/v3/patrol/inspectionPoint/query/${id}`);
  },
  /**
   * @description: 新增巡检点信息
   * @param {Object} formData *
   * @return {Object}
   */
  addInspectionPointInfo(formData) {
    formData.organizationNo = sessionStorage.organizationNo
    return request.post("/v3/patrol/inspectionPoint/add", formData);
  },
  /**
   * @description: 编辑巡检点信息
   * @param {Object} formData *
   * @return {Object}
   */
  editInspectionPointInfo(formData) {
    formData.organizationNo = sessionStorage.organizationNo
    return request.post("/v3/patrol/inspectionPoint/edit", formData);
  },
  /**
   * @description: 批量删除数据
   * @param {Array} list *
   * @return {Object}
   */
  delInspectionPointInfo(list) {
    return request.post("/v3/patrol/inspectionPoint/delList", {
      inspectionPointIdList: list
    });
  },
  queryByConditionList(params) {
    return request.post("/v3/patrol/picture/queryByCondition", {
      pictureId: params.pictureId
    });
  },
  getInspectionTaskList(params) {
    return request.post("/v3/patrol/inspectionTask/queryPageList", params)
  },
  getInspectionResultList(params) {
    return request.post("/v3/patrol/inspectionResult/queryByCondition", {
      inspectionTaskId: params.inspectionTaskId,
      organizationNo: sessionStorage.organizationNo
    })
  },
  inspectionRouteCondition() {
    return request.post("/v3/patrol/inspectionRoute/queryByCondition", {
      organizationNo: sessionStorage.organizationNo
    });
  },
};
